﻿<UserControl x:Class="SparklineDemo.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:oxy="clr-namespace:OxyPlot.Silverlight;assembly=OxyPlot.Silverlight" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <Grid x:Name="LayoutRoot" Background="White" Width="400" Height="600" Margin="0,100,0,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <TextBlock Text="Sparklines" FontWeight="Bold" FontSize="16"/>
        <ItemsControl Grid.Row="1" ItemsSource="{Binding Trends}">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Grid Margin="4">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="2*"/>
                            <ColumnDefinition Width="2*"/>
                            <ColumnDefinition Width="1*"/>
                        </Grid.ColumnDefinitions>
                        <oxy:Plot Background="#e0e0e0" Height="30" Model="{Binding PlotModel}" HandleRightClicks="False"/>
                        <TextBlock Text="{Binding Name}" FontWeight="Bold" Grid.Column="1" Margin="4 0 4 0" VerticalAlignment="Center"/>
                        <TextBlock Text="{Binding LastValue, StringFormat='{}{0:0.000}'}" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Column="2"/>
                    </Grid>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </Grid>
</UserControl>
